//
//  ZH_PaySuccessViewController.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/27.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_PaySuccessViewController.h"

@interface ZH_PaySuccessViewController ()
@property (nonatomic,weak)UIImageView *topImage;
@property (nonatomic,weak)UILabel *successLabel;
@property (nonatomic,weak)UIButton *successButton;
@end

@implementation ZH_PaySuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUserInterface];
}

- (void)initUserInterface{
    self.navigationItem.title = @"支付结果";
    self.view.backgroundColor = kCommonBackgroudColor;
    [self.topImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(FITSCALE(40));
        make.centerX.equalTo(self.view);
    }];
    [self.successLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.topImage.mas_bottom).offset(FITSCALE(14));
    }];
    [self.successButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.successLabel.mas_bottom).offset(FITSCALE(75));
        make.left.equalTo(self.view).offset(FITSCALE(22));
        make.right.equalTo(self.view).offset(FITSCALE(-22));
        make.height.mas_equalTo(FITSCALE(44));
    }];
}

#pragma mark - getter,setter
- (UIImageView *)topImage{
    if (!_topImage) {
        UIImageView *image = [UIImageView createImageViewWithName:@"img_success"];
        [self.view addSubview:_topImage = image];
    }
    return _topImage;
}
- (UILabel *)successLabel{
    if (!_successLabel) {
        UILabel *label = [UILabel createLabelWithText:@"付款成功!" font:kFontSize_30];
        [self.view addSubview:_successLabel = label];
    }
    return _successLabel;
}
- (UIButton *)successButton{
    if (!_successButton) {
        UIButton *button = [UIButton createNoBgButtonWithTitle:@"去评价" target:self action:nil];
        button.backgroundColor = [UIColor colorWithHexString:@"#00C9AE"];
        [button setTitleColor:kFontColorWhite forState:UIControlStateNormal];
        button.titleLabel.font = kFontSize_34;
        button.layer.cornerRadius = FITSCALE(21);
        button.layer.masksToBounds = YES;
        button.clipsToBounds = YES;
        [self.view addSubview:_successButton = button];
    }
    return _successButton;
}

@end
